<template>
  <div>
    <div class="container radiusBottom">
      <div class="images">
        <div class="img">
          <img :src="styleUrls[dataJson.type][dataJson.stylesType]" />
        </div>
        <div class="buttonSetStyle" @click="alertTag">修改样式</div>
      </div>
    </div>
    <div class="container p_20 p_t_0">
      <div class="headerNav">
        <ul>
          <li @click="shopActive = 0">
            <!--        :class="{ shopCheck: shopActive == 0, shop_style_0: true }" -->
            选择文章
          </li>
        </ul>
      </div>
      <div class="sectionShop">
        <div v-show="shopActive == 0" class="clearfix top p_t_20">
          <button
            class="buttonFunction"
            @click="(dialogFormVisible = true), (alertLinkName = '文章模块')"
          >
            选择文章
          </button>
          <span>上下拖拽可排序</span>
        </div>
        <div class="commodityList">
          <ul>
            <li
              v-for="(shopitem, shopindex) in dataJson.shopId"
              v-show="shopActive == 0 || 1"
              :key="shopindex"
              class="clearfix"
              draggable="true"
              @dragstart.capture="dragstartListSort(shopindex, $event)"
              @drop.stop="dropListSort(shopindex, $event, 'shopId')"
              @dragover.prevent="dragoverListSort"
            >
              <img
                :src="
                  $store.state.qiniu + shopitem.linkSrc + $store.state.imgRotate
                "
              />
              <span class="goods_name">
                {{ shopitem.jump_name }}
              </span>
              <span class="delsz" @click="deleteShopIdItem(shopindex)">
                删除
              </span>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { styleUrls } from "../../data";
export default {
  props: {
    dataJson: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      styleUrls
    };
  },
  methods: {
    dragstartListSort(index, e) {
      this.$emit("dragstartListSort", index, e);
    },
    dropListSort(index, e, attr) {
      this.$emit("dropListSort", index, e, attr);
    },
    dragoverListSort() {},
    alertTag() {
      this.$emit("alertTag", true, this.dataJson.stylesType, 30);
    }
  }
};
</script>
<style lang="scss" scoped>
@import "~@/assets/scss/decorate.scss";
</style>
